package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.vo.ecology.UserExpendRecordsPageVO;
import com.sc.nft.entity.vo.ecology.UserReforgeExpendRecordsPageVO;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.UserEcologyReforgeRecordsDetails;
import com.sc.nft.mapper.UserEcologyReforgeRecordsDetailsMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

/**
 * 生态-重铸-用户记录表-主表(sc_user_ecology_reforge_records_details)数据DAO
 *
 * @author Sun
 * @description 由 Mybatisplus Code Generator 创建
 * @since 2024-06-15 11:03:13
 */
@Slf4j
@Repository
public class UserEcologyReforgeRecordsDetailsDao extends ServiceImpl<UserEcologyReforgeRecordsDetailsMapper, UserEcologyReforgeRecordsDetails> {

    public Page<UserReforgeExpendRecordsPageVO> expendRecordsPage(Long userId, Integer pageNo, Integer pageSize,Long creatorId) {
        return baseMapper.expendRecordsPage(new Page<>(pageNo, pageSize), userId,creatorId);
    }

    /**
     * 获取用户已经使用的免费重铸次数
     *
     * @param userId
     * @param collectionId
     * @return
     */
    public Integer getUseFreeCount(Long userId, Long collectionId) {
        return baseMapper.getUseFreeCount(userId, collectionId);
    }
}